package com.getpebble.android.framework;

import com.getpebble.android.bluetooth.device.ConnectionResult;
import com.getpebble.android.bluetooth.protocol.ProtocolMessage;
import com.getpebble.android.common.model.PblDevice;
import java.util.Set;

public class DeviceInterfaces {

    public interface IAdapterQuery {
        boolean cancelDiscovery();

        boolean getAdapterEnabled();

        boolean isDiscovering();

        void registerBluetoothAdapterCallback(IAdapterQueryCallback iAdapterQueryCallback);

        boolean startDiscovery();

        void unregisterBluetoothAdapterCallback(IAdapterQueryCallback iAdapterQueryCallback);
    }

    public interface IAdapterQueryCallback {
        void onAdapterError();

        void onAdapterStateChanged(boolean z);
    }

    public interface IDeviceConnector {
        boolean connectToDevice(PblDevice pblDevice);

        boolean disconnectFromDevice(PblDevice pblDevice);

        void registerBluetoothConnectionCallback(IDeviceConnectorCallback iDeviceConnectorCallback);

        void unregisterBluetoothConnectionCallback(IDeviceConnectorCallback iDeviceConnectorCallback);
    }

    public interface IDeviceConnectorCallback {
        void onDeviceConnectionResult(PblDevice pblDevice, ConnectionResult connectionResult);

        void onDeviceDisconnected(PblDevice pblDevice);
    }

    public interface IDeviceFetcher {
        Set<PblDevice> getBondedPblDevices();

        void registerBluetoothDevicesCallback(IDeviceFetcherCallback iDeviceFetcherCallback);

        void unregisterBluetoothDevicesCallback(IDeviceFetcherCallback iDeviceFetcherCallback);
    }

    public interface IDeviceFetcherCallback {
        void onDeviceBonded(PblDevice pblDevice);

        void onDeviceDiscovered(PblDevice pblDevice);

        void onDeviceUnbonded(PblDevice pblDevice);
    }

    public interface IDeviceMessageReceivedCallback {
        void onDeviceMessageReceived(PblDevice pblDevice, ProtocolMessage protocolMessage);

        void onMessageSendFailed(PblDevice pblDevice);

        void onMessageSendSuccess(PblDevice pblDevice);
    }

    public interface IDeviceMessageSender {
        void registerBluetoothMessageCallback(IDeviceMessageReceivedCallback iDeviceMessageReceivedCallback);

        void registerMessageSentCallback(IDeviceMessageSentCallback iDeviceMessageSentCallback);

        boolean sendMessage(PblDevice pblDevice, ProtocolMessage protocolMessage);

        void unregisterBluetoothMessageCallback(IDeviceMessageReceivedCallback iDeviceMessageReceivedCallback);

        void unregisterMessageSentCallback(IDeviceMessageSentCallback iDeviceMessageSentCallback);
    }

    public interface IDeviceMessageSentCallback {
        void onDeviceMessageSent(PblDevice pblDevice, ProtocolMessage protocolMessage);
    }
}
